-
Notifications
You must be signed in to change notification settings - Fork 260
fix: delete file lost wake #1323
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
match self.state.try_read() { | ||
Ok(guard) => match guard.deref() { | ||
DeleteFileIndexState::Populated(idx) => Poll::Ready(Ok( | ||
idx.get_deletes_for_data_file(self.data_file, self.seq_num) | ||
)), | ||
_ => Poll::Pending, | ||
}, | ||
Err(err) => Poll::Ready(Err(Error::new(ErrorKind::Unexpected, err.to_string()))), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have 2 possible problems here:
try_read
returnsTryLockError::WouldBlock
, which should not be an error, butPending
.- More severely, we don't have any
Waker
set, so oncePending
, the future will sleep forever.
Therefore, I think it's better to replace manual Future
implementation with other sync primitives.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've addressed the missing Waker in my open PR in my open PR: 5f0b073
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
which PR?
BTW, it seems in this commit the TryLock problem is not resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BTW, I think manual Future
implementation should be discouraged in favor of async fn
with synchronisation primitives.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, it's in #982
Signed-off-by: xxchan <[email protected]>
abb3e65
to
596dc07
Compare
Signed-off-by: xxchan <[email protected]>
Which issue does this PR close?
What changes are included in this PR?
Fix bug caused in #652
For detail see inline comments
Are these changes tested?